#include <iostream>
#include <string>
#include "listener.hpp"
#include "Connection.hpp"
#include "Reactor.hpp"

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cout << "Usage: " << argv[0] << " port" << std::endl;
        return 1;
    }
    uint16_t local_port = std::stoi(argv[1]);
    Rector epoll_svr;

    auto conn = std::make_shared<Listener>(local_port);

    epoll_svr.InsertConnection(conn);
    epoll_svr.Loop();

    return 0;
}